package com.woniu.command.regionCommand;

import com.woniu.command.Command;
import com.woniu.command.handler.RegionCommandHandler;
import com.woniu.outlet.po.RegionPo;
import com.woniu.utils.ApplicationContextHolder;

public class UpdateRegionCommand implements Command<RegionPo, Integer> {

    private RegionCommandHandler handler;

    public UpdateRegionCommand() {
        this.handler = ApplicationContextHolder.getApplicationContext()
                .getBean(RegionCommandHandler.class);
    }

    @Override
    public Integer execute(RegionPo regionPo) {
        return this.handler.updateRegion(regionPo);
    }
}
